package com.lex.data.admin.service.impl;

import com.lex.data.admin.mapper.LexSysLogMapper;
import com.lex.data.admin.model.LexSysLog;
import com.lex.data.admin.service.MySysLogService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.sql.Timestamp;

@Service
public class MySysLogServiceImpl implements MySysLogService {

    @Autowired
    private LexSysLogMapper lexSysLogMapper;
    /**
     * 插入系统日志
     * @param log
     */
    @Override
    public void insertOperlog(LexSysLog log) {
        long now_time = System.currentTimeMillis();
        //转换为时间戳
        Timestamp time = new Timestamp(now_time);
        log.setOperTime(time);
        lexSysLogMapper.insert(log);
    }
}
